<?php
	@session_start();
	setlocale(LC_ALL,'es_CO');
	date_default_timezone_set("America/Bogota");
	ini_set('display_errors',0);
	
	include("class/RijndaelHex.php");
	
	include("globals.php");
	require_once("Browser.php");
	
	connectDbMasterUnlock() or die("Sitio en Mantenimiento...");	
	
	$currencies = getCurrencies();//valor de las monedas en pesos colombianos.
	define('__CURR_US__', $currencies[0]);
	define('__CURR_BOL__', $currencies[1]);
	
	//error_reporting( E_ALL );//muestra todos los errores
	
	//Connecta con la BD del reseller.
	function connectDbReseller($data){
		$dbhost = $data->dbhost;
		$dbname = $data->dbname;
		$dbuser = $data->dbuser;
		$dbpass = $data->dbpass;
		if(mysql_connect ($dbhost, $dbuser, $dbpass))
			return mysql_select_db($dbname);
		return false;
	}
	
	//Conecta con la BD de master-unlock.com
	function connectDbMasterUnlock(){
		$dbhost = "localhost";
		$dbname = "masteru_master";
		$dbuser = "root";
		$dbpass = ""; 
	
		mysql_connect ($dbhost, $dbuser, $dbpass);
		define('__DB_MASTERUNLOCK__',$dbname);
		return mysql_select_db($dbname);
	}
	
	if ( isset ( $_GET["create_triggers_imei"] ) && $_GET["create_triggers_imei"] > 0)
		createTriggersImei((int) $_GET["create_triggers_imei"]);
		
	if ( isset ( $_GET["create_triggers_2"] ) && $_GET["create_triggers_2"] > 0)
		createTriggers2((int) $_GET["create_triggers_2"]);
	
	require_once 'phpids.php';
?>